<?php
echo PHP_VERSION, PHP_EOL;
error_reporting(-1);
// START@#2017-04-#  // END@#2017-04-#

// START@#2017-04-#
$arr = [];

$i = 50;

while($i-- > 0){
    $key = random_int(1, 5);
    isset($arr[$key]) && $arr[$key]++ || $arr[$key] = 1;
    // $arr[$key]++;
}
var_dump($arr);


exit;
// END@#2017-04-#

// START@#2017-04-#
$arr = [0, 1];
$arr = array_merge($arr, [0, 1]);

var_dump($arr);

// var_dump(ctype_alpha('ad'));
exit;

// END@#2017-04-#


// START@#2017-04-#

// END@#2017-04-#

// START@#2017-04-20_1018#

$pattern = '/(?(?<=8)(\d+)|(\w{3}))/';

$str = '10086111110000';

echo preg_match($pattern, $str, $match), PHP_EOL;

var_dump($match);

exit;
// $pattern = '/(?(\w+(?:区|县)) ^(.{2,}旗)(?:区|县)$ | ^(.*(?:地区|自治州|盟))(?:市|市辖区)$)/u';

// exit;
// $pattern = '~^(?|(.*(?:地区|自治州|盟))(?:市|市辖区)|(.{2,}旗)(?:区|县))$~u';
// $pattern = '~^(.*(?:地区|自治州|盟))(?:市|市辖区)$~u';
$testData = [
    '阿勒泰地区市',
    '嘎是撒法自治州市',
    '啊发生法旗区',
    '啊是发旗县',
    '红旗区'
];

foreach ($testData as $value) {
    echo preg_match($pattern, $value, $match), PHP_EOL;
    var_dump($match);
}
exit;
// END@#2017-04-20_1018#





// START@#2017-04-19#
$str = '10086';
echo strlen('310100000000'), PHP_EOL;
$len = 12;
$padding = 0;
echo str_pad($str, $len , $padding);
// END@#2017-04-19#
